#include "Land.h"
#include <gl/glut.h>
#define MAX_COORD 1000
void Land::Update()
{

}

void Land::Draw()
{
	GLfloat ambient_and_diffuse[] = {95.0f/256, 158.0f/256, 160.0f/256, 1.0f};
	GLfloat specular[] = {0.0f,0.0f,0.3f,1.0f};
	GLfloat emission[] = {0.0f, 0.0f, 0.0f ,1.0f};
	GLfloat shininess = 20.0f;

	::glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, ambient_and_diffuse);
	::glMaterialfv(GL_FRONT, GL_SPECULAR, specular);
	::glMaterialfv(GL_FRONT, GL_EMISSION, emission);
	::glMaterialf(GL_FRONT, GL_SHININESS, shininess);

	glColor3f(1.0, 1.0, 1.0);
	int iLen = 10;
	glLineWidth(0.2);
    for(int i = -MAX_COORD; i <= MAX_COORD; i += iLen)
	{
		for (int j = -MAX_COORD; j <= MAX_COORD; j += iLen)
		{
			glBegin(GL_LINE_LOOP);
				glVertex3f(i, 0.0, j);
				glVertex3f(i + iLen, 0.0, j);
				glVertex3f(i + iLen, 0.0, j + iLen);
				glVertex3f(i, 0.0, j + iLen);
			glEnd();
		}
	}

	/*::glPushMatrix();

	::glBegin(GL_QUADS);
	::glVertex3d(-1000,0,-1000);
	::glVertex3d(1000,0,-1000);
	::glVertex3d(1000,0,1000);
	::glVertex3d(-1000,0,1000);
	::glEnd();

	::glPopMatrix();*/
}
